package com.yuyou.fn.analyze.service;


import com.github.wens.mybatisplus.plugins.Page;
import com.yuyou.fn.analyze.vo.*;
import com.yuyou.fn.educational.entity.PeriodSegment;
import com.yuyou.fn.educational.entity.Teacher;
import com.yuyou.fn.educational.vo.CourseClassQueryVo;
import com.yuyou.fn.educational.vo.ExternalRegQueryVo;
import com.yuyou.fn.educational.vo.StudentRefundQueryVo;
import com.yuyou.fn.educational.vo.TeacherQueryVo;
import com.yuyou.fn.platform.permission.DataPermission;
import com.yuyou.fn.report.vo.*;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/9/5.
 */
public interface IIndexStatisticsService {

    List<NeedDealNumVo>  countResourceNeedToDeal(Long areaTeamId, DataPermission dataPermission);

    DataCountVo findDataCount(String year,DataPermission dataPermission,Long areaTeamId,List<Long> periodIds,List<Long> gradeIds);

    CampusSeqStepRateVo findCampusSeqStepRate(String year,Long areaTeamId,DataPermission dataPermission,List<Long> periodIds,List<Long> gradeIds);;


    //咨询师科数统计（奖金指标）新老生科数的统计，以生源类型为准，只要是新老生产生的报读科数，均计算新老生科数；
    Page<CounselorBranchBonusVo> findCounselorBranchBonusPage(List<Long> busTeamIds, PeriodQueryRegVo periodQueryRegVo, DataPermission dataPermission, TeacherQueryVo teacherQueryVo, List<Long> periodIds, int pageNo, int pageSize, Integer bigLectureNum);

    //导出咨询师科数统计（奖金指标）
    SXSSFWorkbook exportCounselorBranchBonus(List<Long> busTeamIds,PeriodQueryRegVo periodQueryRegVo, DataPermission dataPermission, TeacherQueryVo teacherQueryVo, List<Long> periodIds, Integer bigLectureNum);

    //班主任续读科数的统计，基于生源类型，只要是续读生产生的报读科数，均计算续读科数，不需科对科
    Page<SeniorBranchBonusVo> findSeniorBranchBonusPage(List<Long> busTeamIds, RegRelativceQueryVo regRelativceQueryVo, DataPermission dataPermission, TeacherQueryVo teacherQueryVo, List<Long> periodIds,  int pageNo, int pageSize, Integer bigLectureNum);

    //导出班主任续读（奖金指标）
    SXSSFWorkbook exportSeniorBranchBonus(List<Long> busTeamIds,List<Integer> relativeTypes, String teacherType, RegRelativceQueryVo regRelativceQueryVo, DataPermission dataPermission, TeacherQueryVo teacherQueryVo, List<Long> periodIds,  Integer bigLectureNum);


    /*教师续读统计（奖金指标）
    * */
    Page<ClassComletionRateVo> findClassComletionRateVoPage(List<Long> periodIds,List<Long> busTeamIds,List<Long> gradeIds, CourseClassQueryVo courseClassQueryVo, DataPermission dataPermission, int pageNo, int pageSize,RegRelativceQueryVo regRelativceQueryVo);

    /*导出续读统计（奖金指标）
   * */
    SXSSFWorkbook exportClassComletionRate(List<Long> periodIds,List<Long> busTeamIds,List<Long> gradeIds,  CourseClassQueryVo courseClassQueryVo, DataPermission dataPermission, RegRelativceQueryVo regRelativceQueryVo,List<Integer> relativeTypes );


    /*教师任教情况统计（奖金指标）*/
    Page<ClassLectureGroupDetailVo> findClassLectureGroupDetail(DataPermission dataPermission,List<Long> busTeamIds,List<Long> periodIds,List<Long> gradeIds,ClassLectureDetailQueryVo classLectureDetailQueryVo,int pageNo,int pageSize);

    /*导出教师任教情况统计（奖金指标）*/
    SXSSFWorkbook exportClassLectureGroupDetail(DataPermission dataPermission,List<Long> busTeamIds,List<Long> periodIds,List<Long> gradeIds,ClassLectureDetailQueryVo classLectureDetailQueryVo);

    /*校区续读统计（营运指标）*/
    List<GradeCompletionRateVo> findGradeCompletionVoList(Long areaTeamId,List<Long> busTeamIds,List<Long> periodIds,List<Long> gradeIds,List<Long> subjectIds);


    BusTeamPeriodSeqStepNumVo findBusTeamPeriodSeqStepNum(long areaTeamId,long busTeamId,long periodId);

    /*导出校区续读统计（营运指标）*/
    SXSSFWorkbook exportGradeCompletionRate(Long areaTeamId,List<Long> busTeamIds,List<Long> periodIds,List<Long> gradeIds);

    /*班主任续读统计（营运指标）*/
    Page<SeniorCompletionRateVo> findSeniorComletionRateVoPage(TeacherQueryVo teacherQueryVo,List<Long> busTeamIds,List<Long> periodIds,List<Long> gradeIds,int pageNo,int pageSize);

    List<StudentContinueRegDetailVo> findStudentContinueRegDetail(TeacherQueryVo teacherQueryVo,List<Long> busTeamIds,List<Long> periodIds,List<Long> gradeIds);

    /*导出班主任续读统计（营运指标）*/
    SXSSFWorkbook exportSeniorComletionRate(TeacherQueryVo teacherQueryVo,List<Long> busTeamIds,List<Long> periodIds,List<Long> gradeIds) ;

    /*咨询师科数统计（营运指标）*/
    Page<CounselorRateVo> findCounselorComletionRateVoPage(PeriodQueryRegVo periodQueryRegVo, TeacherQueryVo teacherQueryVo, List<Long> busTeamIds, List<Long> periodIds, int pageNo, int pageSize);

    SXSSFWorkbook exportCounselorComletionRateVoPage(PeriodQueryRegVo periodQueryRegVo, TeacherQueryVo teacherQueryVo, List<Long> busTeamIds, List<Long> periodIds);


    /**
    *@Description: 营业概况
    *@Param: needWithPeriod（1 查询同期） ，findPeriodGradeSubject（1 查询区域年级科目预收）
    *@return:
    *@Author: lzh
    *@date:
    */
    SitutaionVo findBusinessSituationList(DataPermission dataPermission,Long areaTeamId,List<Long> busTeamIds, List<Long> periodIds,List<Long> gradeIds,List<Long> subjectIds,Date startDate,Date endDate,int needWithPeriod,int findPeriodGradeSubject);

    SXSSFWorkbook exportBusinessSituation(DataPermission dataPermission,Long areaTeamId,List<Long> busTeamIds, List<Long> periodIds,List<Long> gradeIds,List<Long> subjectIds,Date startDate,Date endDate,int needWithPeriod);

    /*
    * 遍历学生报名信息，根据学生生源对数据统计
    * */
    BlockVo findBlockVo(DataPermission dataPermission,Long areaTeamId,List<Long> busTeamIds, List<Long> periodIds,List<Long> gradeIds,List<Long> subjectIds,Date startDate,Date endDate);


    List<AdvanceBlockVo> findAdvanceBlock(DataPermission dataPermission,Long areaTeamId, List<Long> busTeamIds, List<Long> periodIds, List<Long> gradeIds,List<Long> subjectIds, Date startDate, Date endDate) ;


    BusTeamPeriodAdvanceVo findBusTeamPeriodAdvance(long areaTeamId,long busTeamId,long periodId,String endDate);

    List<StudentStateBlockVo> findStudentStateBlock(DataPermission dataPermission,Long areaTeamId, List<Long> busTeamIds, List<Long> periodIds, List<Long> gradeIds,List<Long> subjectIds, Date startDate, Date endDate);

    BusTeamPeriodStudentNumVo findBusTeamPeriodStudentNum(long areaTeamId, long busTeamId, long periodId, String endDate);

    List<BranchNumBlockVo> findBranchNumBlockVo(DataPermission dataPermission,Long areaTeamId, List<Long> busTeamIds, List<Long> periodIds, List<Long> gradeIds, List<Long> subjectIds,Date startDate, Date endDate) ;

    BusTeamPeriodBranchNumVo findBusTeamPeriodBranchNum(long areaTeamId, long busTeamId, long periodId, String endDate);

    SXSSFWorkbook exportBlock(DataPermission dataPermission,Long areaTeamId,List<Long> busTeamIds, List<Long> periodIds,List<Long> gradeIds,List<Long> subjectIds,Date startDate,Date endDate);


    AmountBranchPerson findAmountBranchPerson(List<Long> busTeamIds,Long areaTeamId, List<Long> periodIds, List<Long> gradeIds, Date startDate,Date endDate);

    SXSSFWorkbook exportAmountBranchPerson(List<Long> busTeamIds,Long areaTeamId, List<Long> periodIds, List<Long> gradeIds, Date startDate,Date endDate);

    /*
    *@param needWithPeriod 0不查同期，1查同期
    *@param needFindRefund 0不用查该时间的退费，1查
    * */
    PeriodRegVo findPeriodAndWithPeriod(Long areaTeamId,List<Long> busTeamIds, List<Long> periodIds,List<Long> gradeIds,List<Long> subjectIds,Date startDate,Date endDate,List<Integer> regStatuses,int needWithPeriod,int needFindRefund);


    Page<TeacherCommissionDetail> findTeacherCommissionPage(TeacherQueryVo teacherQueryVo,DataPermission dataPermission,List<PeriodTypeQueryVo> periodTypeQueryVoList,int pageNo,int pageSize);

    SXSSFWorkbook exportTeacherCommission(TeacherQueryVo teacherQueryVo,DataPermission dataPermission,List<PeriodTypeQueryVo> periodTypeQueryVoList);


    List<ExternalCampusRegVo> findExternalCampusReg(List<Long> periodIds, ExternalRegQueryVo externalRegQueryVo);

    List<ExternalSeniorRegVo> findExternalSeniorReg(List<Long> periodIds, ExternalRegQueryVo externalRegQueryVo);

    SXSSFWorkbook exportExternalCampusReg(List<Long> periodIds,  ExternalRegQueryVo externalRegQueryVo);

    SXSSFWorkbook exportExternalSeniorReg(List<Long> periodIds,  ExternalRegQueryVo externalRegQueryVo);

    Page<ClassRegDetailVo> findClassRegDetailPage(CourseClassQueryVo courseClassQueryVo, DataPermission dataPermission,int pageNo, int pageSize);

    SXSSFWorkbook exportClassRegDetail(CourseClassQueryVo courseClassQueryVo,DataPermission dataPermission);

    /*只查某一年的寒春 -- 暑秋的推广数据*/
    Page<AcademicAdvisorDataVo> findAcademicAdvisorData(Long areaTeamId,TeacherQueryVo teacherQueryVo,Date startDate,Date endDate,int pageNo,int pageSize);

    SXSSFWorkbook exportAcademicAdvisorData(Long areaTeamId,TeacherQueryVo teacherQueryVo,Date startDate,Date endDate);

    /*网报排行榜*/
    OnlineList findOnlineList(Long areaTeamId,List<Long> periodIds, PeriodQueryRegVo periodQueryRegVo);

    SXSSFWorkbook exportOnlineList(Long areaTeamId,List<Long> periodIds, PeriodQueryRegVo periodQueryRegVo);

    PerimissionTypeListVo checkAndFillDataPerssion(DataPermission dataPermission,Long areaTeamId,List<Long> busTeamIds,List<Long> gradeIds,List<Long> subjectIds);


    Page<StudentRefundDetailVo> findStudentRefundBonusPersonPage(StudentRefundQueryVo studentRefundQueryVo, DataPermission dataPermission, int pageNo, int pageSize);

    SXSSFWorkbook exportStudentRefundBonusPerson(StudentRefundQueryVo studentRefundQueryVo, DataPermission dataPermission);

    List<PeriodSubjectContinueVo> findPeriodSubjectContinue(Long areaTeamId,Long periodId, DataPermission dataPermission);

    List<PeriodSubjectTeacherContinueVo> findPeriodSubjectTeacherContinue(Long areaTeamId,Long periodId, String teacherName,DataPermission dataPermission);

    SXSSFWorkbook exportPeriodSubjectContinue(Long areaTeamId,Long periodId, DataPermission dataPermission);

    SXSSFWorkbook exportPeriodSubjectTeacherContinue(Long areaTeamId,Long periodId, String teacherName,DataPermission dataPermission);

    Page<TeacherTeachDetailVo> findTeacherTeachDetailPage(DataPermission dataPermission,TeacherTeachDetailQueryVo teacherTeachDetailQueryVo,int pageNo,int pageSize);

    SXSSFWorkbook exportTeacherTeachDetail(DataPermission dataPermission,TeacherTeachDetailQueryVo teacherTeachDetailQueryVo);
}
